﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WSAP
{
    public partial class PDeltaTestForm : Form
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public PDeltaTestForm()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 截面尺寸
        /// </summary>
        private double dimension
        {
            get
            {
                return Convert.ToDouble(this.DimensionTextbox.Text);
            }
        }

        /// <summary>
        /// 构件长度
        /// </summary>
        private double length
        {
            get
            {
                return Convert.ToDouble(this.LengthTextbox.Text);
            }
        }

        /// <summary>
        /// 竖向力
        /// </summary>
        private double verticalLoad
        {
            get
            {
                return Convert.ToDouble(this.VLTextbox.Text);
            }
        }

        /// <summary>
        /// 水平力
        /// </summary>
        private double horizontalLoad
        {
            get
            {
                return Convert.ToDouble(this.HLTextbox.Text);
            }
        }

        /// <summary>
        /// 剖分数
        /// </summary>
        private int MeshNumber
        {
            get
            {
                return Convert.ToInt32(this.MeshTextbox.Text);
            }
        }

        /// <summary>
        /// PDeltaExampleWithSingleLinearAnalyze
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SLAButton_Click(object sender, EventArgs e)
        {
            WSAPCantileverColumn.PDeltaExampleWithSingleLinearAnalyze(this.dimension, this.dimension, this.length, this.MeshNumber,
                this.horizontalLoad, this.verticalLoad);
        }

        /// <summary>
        /// PDeltaExampleWithDoubleLinearAnalyze
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DLAButton_Click(object sender, EventArgs e)
        {
            WSAPCantileverColumn.PDeltaExampleWithDoubleLinearAnalyze(this.dimension, this.dimension, this.length, this.MeshNumber,
               this.horizontalLoad, this.verticalLoad);
        }

        /// <summary>
        /// PDeltaExampleWithSingleGeneralAnalyze
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SGAButton_Click(object sender, EventArgs e)
        {
            WSAPCantileverColumn.PDeltaExampleWithSingleGeneralAnalyze(this.dimension, this.dimension, this.length, this.MeshNumber,
               this.horizontalLoad, this.verticalLoad);
        }
    }
}
